#pragma once

#include <string>
#include <vector>
using namespace std; 

namespace messaging{

enum MessageRecipient{
	KBenchmark = 0,
	KEnvShell = 1,
	KAgentShell =2, 
	KEnv = 3, 
	KAgent = 4 
}; 


enum MessageType{
	KAgentResponse = 0, 
	KAgentQueryValuesForObs = 1, 
	KAgentCustom = 2, 
	KAgentQuerySupportedVersion=4, 
	KAgentQueryVisualizerName=6,
	KAgentGetGraphic=7
}; 

enum ValueType{
	KStringList = 0, 
	KString = 1, 
	KBoolean = 2, 
	KNone = 3

}; 

class GenericMessage
{
public:
	GenericMessage(const char* msg);
	GenericMessage(MessageRecipient pfrom, MessageRecipient pto, MessageType pcmd, ValueType pvalType);  
	~GenericMessage(void);
	
	virtual string makeMessage(); 
	void setContent(string& s); 
public:
	string content; 
	MessageRecipient from; 
	MessageRecipient to; 
	MessageType cmd; 
	ValueType valType; 

	const char* toString(); 

protected: 
	void tokenize(const string& str,vector<string>& tokens, const string& delimiters ); 
	int str2int(string& str) const; 
	double str2double(string& str) const; 

};


}
